INSTALLDIR = ../bin/
OCAMLDOCFLAGS=-html -inv-merge-ml-mli -m A   -d ../doc

export OCAMLMAKEFILE = $(shell pwd)/OCamlMakefile

# Project "vmggtk" -- interface with gtk and graphics
define PROJ_vmggtk
INCDIRS = +lablgtk2
LIBS = lablgtk
SOURCES = gtkInit.cmo vmg.mli vmg.ml \
	vector.mli vector.ml \
	graphicsGTK.mli graphicsGTK.ml \
	graphicsHIGH.ml \
	licence.ml interface_gtk.ml
RESULT  = vmgcalcgtk
endef
export PROJ_vmggtk

# Project "vmg" -- text based interface
define PROJ_vmg
INCDIRS = 
LIBS = 
SOURCES = vmg.ml  interface.ml
RESULT  = vmgcalc
endef
export PROJ_vmg

# We compile only the gtked program
ifndef SUBPROJS
  export SUBPROJS = vmggtk 
#  export SUBPROJS = vmggtk vmg 
endif

# Default target to use
all:	nc

# Catch-all target will be applied to all subprojects automatically
%:
	@$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@ 

PHONY: mydoc

mydoc:
	ocamldoc $(OCAMLDOCFLAGS) vmg.mli vmg.ml \
	graphicsGTK.mli graphicsGTK.ml 

install:
	cp vmgcalcgtk $(INSTALLDIR)

windows:
	make -f Makefile_windows

